<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="list"></div>
    <script src="jslib/mustache.js"></script>
    <script>
        // 循环数组
        var templateStr = `
            <ul>
                {{#arr}}
                <li>
                    {{.}}
                </li>
                {{/arr}}
            </ul>
        `;

        var data = {
            arr: ["a", "b", "c"],
        }

        var domStr = Mustache.render(templateStr, data);
        console.log(domStr);

        let div = document.querySelector("div");
        div.innerHTML = domStr;
    </script>
</body>

</html>